<?php
if (isset($_SESSION['X_CART'])){
	$cart = $_SESSION['X_CART'];
	$pids = $cart->getProducts();
	$cpids = count($pids);
	if($cpids == 0){
		$cpids =NULL;
	}
}
?>

<div id="nav">
<div class="wrapper">
<h2 class="accessibility">Navigation</h2>
	  <ul id="primary-nav" class="menuList">
    	<li><a href="index.php" title="Home">Home</a></li>
<?php
if (!isset($_SESSION['X_USER'])) {
?>
	    <li><a href="index_public.php?entity=public&action=finance&title=Finance">Finance</a></li>
	    <li><a href="index_public.php?entity=public&action=aboutus&title=About Us">About us</a></li>
	    <li><a href="index_public.php?entity=public&action=contact&title=Contact Us">Contact us</a></li>
		<li><a href="index_public.php?entity=public&action=enquiry&title=Enquiry">Enquiry</a></li>
<?php
}else{
?>

<?php
}
if (Security::isCurrentUserGrantedWith("ROLE_ADMIN")) {
?>
		<li><a href="index_user.php?action=new">User </a></li>
		<li><a href="index_admin.php?entity=car&action=list">Car </a></li>
		<li><a href="index_admin.php?entity=caroption&action=list">Car Options</a></li>
<!-- 
		<li><a href="index_admin.php?entity=category&action=new">Category</a></li>
   		<li><a href="index_cart.php?action=list">My Car <?php print ((isset($cpids)) ? "($cpids)":"")?></a></li>
   		<li><a href="index_cart.php?action=list">My Car <?php print ((isset($cpids)) ? "($cpids)":"")?></a></li>
    	<li><a href="index_public.php?entity=car&action=browse">Browse Cars</a></li>
		<li><a href="index_product.php?action=new">Product Management</a></li>
		<li><a href="index_role.php?action=new">Role Management</a></li>
		<li><a href="index_ctype.php?action=new">Customer Type Management</a></li>
		<li><a href="index_details.php?action=report2">10 Best Client</a></li>
		<li><a href="index_details.php?action=report3">10 Best Product</a></li>
		<li><a href="index_details.php?action=report4">Backup Database</a></li>
		 <li><a href="index_order.php?action=list">All Orders</a></li>
   		<li><a href="index_cart.php?action=list">May Car <?php print ((isset($cpids)) ? "($cpids)":"")?></a></li>
		<a href="login.php">Login</a>
		<a href="logout.php">Logout</a>
		<a href="index_customer.php?action=new">Register</a>
 -->		
<?php
}
if (Security::isCurrentUserGrantedWith("ROLE_CUSTOMER")) {
?>	
		<li><a href="index_public.php?entity=public&action=finance&title=Finance">Finance</a></li>
	    <li><a href="index_public.php?entity=public&action=aboutus&title=About Us">About us</a></li>
	    <li><a href="index_public.php?entity=public&action=contact&title=Contact Us">Contact us</a></li>
  		<li><a href="index_public.php?entity=public&action=enquiry&title=Enquiry">Enquiry</a></li>
<?php
}
?>
	  </ul>
</div>
<hr/>
</div>